package com.woniu.coup;

import java.sql.SQLOutput;

/**
 * @author:陈涵
 * @Do:解释耦合，非他不可
 * @date: 2022/8/17 19:21
 */
class Coupling implements  CoupLingInterface{

}
class Coup implements  CoupLingInterface{

}

//
interface CoupLingInterface{

}

public class NoSpring {
    //构造方法,是耦合：NoSpring的类必须传入一个Coupling，才可以构造对象

    //用了多态
    public NoSpring(CoupLingInterface coupling){
        System.out.println(coupling);
    }

   /* //强耦合
    public NoSpring(Coupling coupling){

    }*/

    public static void main(String[] args) {
        NoSpring noSpring=new NoSpring(new Coupling());
        //改需求
        Coup coup=new Coup();
        NoSpring noSpring1=new NoSpring(coup);

    }
}
